 /**Aaron Flaaen */
/**October 11, 2017 */
/**This File Creates Stata-based extracts of CMF/ASM data*/

libname fromcmf  "dir";
libname fromasm "dir";
libname outloc "dir";

/** **********************************************************************/
/** 			SUMMARY OF THIS FILE				*/
/**								       */
/** FILES THAT MUST BE RUN FIRST -- NONE 			      */
/** Step 1. 
/** 								    */
/**								   */
/** OUTPUT 	   						  */
/** **************************************************************/






%macro cmfread(year);

	data cmfdat;
		set fromcmf.cmf&year (keep=survu_id exp firmid tvs fie fib wie wib va mib mie cp);  
	run;

	/* Output to Stata*/
	proc export data = cmfdat
		outfile = "dircmf_tvs_&year..dta"
		dbms = stata replace;
	run;

%mend;
 
%cmfread(2007); 